﻿using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ldhWebApiWpf.database
{
    public class BaseManager
    {
        static IMongoDatabase db;
        public static IMongoDatabase GetDataBase(string dbName)
        {
            if (db == null)
            {
                var client = new MongoClient(ConfigurationManager.AppSettings["mongodb"]);
                db = client.GetDatabase(dbName);
            }
            return db;
        }

    }
}
